import plotly.offline as pyo
from plotly.graph_objs import *
import chart_studio.plotly as py
import pandas as pd
from pandas import DataFrame
pyo.offline.init_notebook_mode()
trace = [{'type' : 'scatter',
'x' : [5],
'y' : [5],}]
layout = {'annotations' : [{'text' : 'Testing',
'xref' : 'x',
'yref' : 'y',
'x' : 5,
'y' : 5,
'showarrow' : False,
'font' : {'size' : 16}}]}
fig = {'data' : trace, 'layout' : layout}
pyo.iplot(fig)
fig['layout']['annotations'][0].update({'xanchor' : 'left'})
pyo.iplot(fig)
fig['layout']['annotations'][0].update({'yanchor' : 'bottom'})
pyo.iplot(fig)
fig['layout']['annotations'][0].update({'xanchor' : 'right'})
pyo.iplot(fig)
fig['layout']['annotations'][0].update({'textangle' : 45})
pyo.iplot(fig)
fig['layout']['annotations'][0].update({'textangle' : 90})
pyo.iplot(fig)